package com.df.springmvc.bi.map.controller;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.df.springmvc.bi.map.services.mapServices;
import com.df.springmvc.common.bean.MsgBean;
import com.df.springmvc.common.util.WebUtil;
import com.df.springmvc.supper.SupperController;



@Controller
@RequestMapping("/bi/map")
/**
 * 信息资源平台地图加载页面控制
 * @author David
 *
 */
public class mapController extends SupperController{
	String page_staff="bi/map/";
	//此标志会初始化services
	@Autowired
	mapServices services;
	
	public mapController(){
		// TODO Auto-generated constructor stub
		// 
	}
	//主页信息 
	@RequestMapping(value={"/"})
	public String excute(ModelMap model,HttpServletRequest request,HttpServletResponse response){
		org.apache.log4j.Logger.getLogger(getClass()).info("mappage");
		return page_staff;
	}
	//首页地图
	@RequestMapping(value={"/tomap" })
	public String toView(ModelMap model,HttpServletRequest request,HttpServletResponse response){
		try{
			
		}catch(Exception e){
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return page_staff + "map";
	}
		/**
		 * 获取首页地图信息
		 * @return
		 * @throws Exception
		 */
		@RequestMapping("/getmapinfo")
		public void getmapinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{ 
				Object o=services.getshiji(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		} 
		
		/** 
		 * 获取省级下辖区地图信息 
		 * @return 
		 * @throws Exception 
		 */ 
		@RequestMapping("/getshengmapinfo")
		public void getshengmapinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{ 
				Object o=services.getshengji(getParamMap(request,"map")); 
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		/**
		 * 获取市级下辖区地图信息 
		 * @return 
		 * @throws Exception
		 */
		@RequestMapping("/getshimapinfo")
		public void getshimapinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{ 
				Object o=services.getshiji(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){ 
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		/** 
		 * 获取省级审批经营下辖区地图信息 
		 * @return 
		 * @throws Exception 
		 */ 
		@RequestMapping("/getjyshengmapinfo")
		public void getjyshengmapinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{ 
				Object o=services.getjyshengji(getParamMap(request,"map")); 
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		/**
		 * 获取行政审批经营市级下辖区地图信息 
		 * @return 
		 * @throws Exception
		 */
		@RequestMapping("/getjyshimapinfo")
		public void getjyshimapinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{ 
				Object o=services.getjyshiji(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){ 
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		
		
		/**
		 * 获取行政审批生产地图信息
		 * @param paramMap
		 * @return
		 */
		@RequestMapping("/XZSP_SC_getmapinfo")
		public void XZSP_SC_getmapinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{ 
				Object o=services.XZSP_SC_getmapinfo(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		} 
		
		/**
		 * 获取行政审批生产市级下辖区地图信息 
		 * @return 
		 * @throws Exception
		 */
		@RequestMapping("/XZSP_SC_getshimapinfo")
		public void XZSP_SC_getshimapinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{ 
				Object o=services.XZSP_SC_getshimapinfo(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){ 
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		/**
		 * 获取第二个地图信息
		 * @return
		 * @throws Exception
		 */
		@RequestMapping("/getmapinfo1")
		public void getmapinfo1(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
				Object o=services.getshiji(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		/** 
		 * 获取第三个地图信息 
		 * @return
		 * @throws Exception
		 */
		@RequestMapping("/getmapinfo2")
		public void getmapinfo2(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
				Object o=services.getshiji(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
}

